package com.five.wisdomEat.controller;

import com.five.wisdomEat.entity.Business;
import com.five.wisdomEat.entity.ResponseMessage;
import com.five.wisdomEat.service.BusinessService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@CrossOrigin
@RestController
@RequestMapping("/business")
public class BusinessController {
    @Autowired
    private BusinessService service;

    @GetMapping("/getBusinessList")
    public ResponseMessage selectBusinessList(String bNumber){
        return service.selectBusinessList(bNumber);
    }

    @PostMapping("/login")
    public ResponseMessage businessLogin(String bNumber, String password){
        Business business =new Business();
        business.setBNumber(bNumber);
        business.setPassword(password);
        return service.login(business);
    }
}
